extends Control

func _on_攻击_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_恶灵_ATTACK):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.恶灵_attack)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()

func _on_附身_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_恶灵_POSSESS):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.恶灵_possess)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()

func _on_攻击_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("灵狩：消耗1点能量，移动到落点，并攻击落点上的敌方幽灵、恶灵和怯战大子，攻击失败则自身死亡，使其获得怯战状态")


func _on_附身_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("附身：消耗3点能量，移动到落点，若落点有敌方怯战大子,则使该大子及其子系叛变，叛变大子可以立即行动")


func _on_mouse_exited():
	var ui = ObjectManager.gameManager.ui as UI
	ui.closeDesc()
